<?php
	require_once("../conf.php");
	class Keywords{
		
		private $keywords;
		private $db;
		
		function __construct(){
			
			try {
			$this->db = pg_connect("host='".DB_HOST."' dbname='".DB_NAME."' user='".DB_USER."' password='".DB_PASS."'");
			}catch (Exception $e){
			echo $e->getMessage();
			}	
		}
		
		function getAll(){
			try {
				$query = "Select name_pl from products;";
				$result = pg_query($this->db,$query);
				
				$row=pg_fetch_all_columns($result,0);
				//print_r($row);
			}catch (Exception $e){
				echo $e->getMessage();
			}
			
			return json_encode($row);
			
		}
		
		 
	}
	
?>